﻿<Window x:Class="personalplaner.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:v="clr-namespace:personalplaner.views"
        xmlns:vm="clr-namespace:personalplaner.common.mvvm.factory;assembly=personalplaner.common"
        xmlns:fac="clr-namespace:personalplaner.viewmodels.factories"
        vm:ViewModelLoader.FactoryType="{x:Type fac:MainWindowFactory}"
        
        xmlns:a="clr-namespace:personalplaner.common.controls.adorners;assembly=personalplaner.common"
        xmlns:c="clr-namespace:personalplaner.common.controls;assembly=personalplaner.common"
        xmlns:uc="clr-namespace:personalplaner.common.utilities.controls;assembly=personalplaner.common"
        xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
        x:Name="ThisWindow"
        
        Foreground="{Binding SelectedItem.Foreground}"
        Loaded="MainWindowLoaded"
         Height="700" Width="1000" Icon="Personalplaner.ico"
        Title="WickedFlame - Personalplaner">
    <!--Title="Personalplaner" Foreground="{Binding SelectedItem.Foreground}"-->

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/resources/MainWindowTemplate.xaml" />
                <ResourceDictionary>
                    <BooleanToVisibilityConverter x:Key="boolToVis"/>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    
    <Window.CommandBindings>
        <CommandBinding Command="{x:Static shell:SystemCommands.CloseWindowCommand}"  Executed="OnSystemWindowCommandExecute"/>
        <CommandBinding Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"  Executed="OnSystemWindowCommandExecute" />
        <CommandBinding Command="{x:Static shell:SystemCommands.MinimizeWindowCommand}"  Executed="OnSystemWindowCommandExecute" />
        <CommandBinding Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"  Executed="OnSystemWindowCommandExecute" />
    </Window.CommandBindings>



    <Border BorderBrush="DarkGray" BorderThickness="1">
        <a:AdornedControl Name="LoadingAdorner" ><!--IsAdornerVisible="True"-->
            <a:AdornedControl.AdornerContent>
                
                <!--<c:VisualWrapper Name="loadingIndicator" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
                <Border Background="Orange" Opacity="0.4"/>
                <!--<uc:CircularLoadingWait />-->
                <!--<uc:TestLoader/>-->
                <!--<uc:ProgressIndicator Name="ProgressIndicator" IsRunning="True" IsIndeterminate="True" HorizontalAlignment="Center" VerticalAlignment="Center" />-->
            </a:AdornedControl.AdornerContent>
            
            
            <Grid Name="ContentDisplay">
                
                <ContentPresenter Content="{Binding SelectedItem}"/>

                <!--<c:VisualWrapper Name="loadingIndicator" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="{Binding ActualWidth, ElementName=ThisWindow}" Height="{Binding ActualHeight, ElementName=ThisWindow}"/>-->
                <!--<uc:LoadingBackground Name="loadingBackground" Width="3000" Height="2000"/>-->
                <c:VisualWrapper Name="loadingIndicator"/>
                
                <Grid>
                    <Grid.RowDefinitions>
                        <!--<RowDefinition Height="Auto"/>-->
                        <RowDefinition/>
                        <RowDefinition Height="20"/>
                    </Grid.RowDefinitions>

                    <!-- Footer -->

                    <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Left" Margin="5" Visibility="{Binding ShowDatabaseName, Converter={StaticResource boolToVis}}">
                        <TextBlock Text="Database" FontSize="10" />
                        <TextBlock Text="|" Margin="3,0,3,0" FontSize="10"/>
                        <TextBlock Text="{Binding Database}" FontSize="10"/>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" Margin="5">
                        <TextBlock Text="Personalplaner" FontSize="10" />
                        <TextBlock Text="|" Margin="3,0,3,0" FontSize="10"/>
                        <TextBlock Text="{Binding Version}" FontSize="10"/>
                    </StackPanel>
                </Grid>

            </Grid>
        </a:AdornedControl>
    </Border>
</Window>
